using System;
using System.Collections.Generic;
using System.Text;
using Pizzaiolo.Core.Gameplay.Characters;
using Pizzaiolo.Core.Gameplay.Items;

namespace Pizzaiolo.DynamicBalancing
{
    public class BalancedWaiter : Waiter
    {

        private List<string> mLevelFivePizzas;
        private List<string> mLevelOnePizzas;
        private List<string> mLevelTwoPizzas;
        private List<string> mLevelThreePizzas;
        private List<string> mLevelFourPizzas;
        
        public BalancedWaiter(Notepad notepad) : base(notepad)
        {
            this.mLevelFivePizzas = new List<string>();
            this.mLevelOnePizzas = new List<string>();
            this.mLevelTwoPizzas = new List<string>();
            this.mLevelThreePizzas = new List<string>();
            this.mLevelFourPizzas = new List<string>();

            dividePizzasByLevel();
        }

        private void dividePizzasByLevel()
        {
            List<string> listOfPizzas = Game.Instance.ChefPizzaiolo.getAvailableRecipes();

            foreach (string name in listOfPizzas)
            {
                Recipe recipe = this.getRecipe(name);

                switch (recipe.UnlockLevel)
                {
                    case 0:
                        {
                            this.mLevelOnePizzas.Add(name);
                            break;
                        }
                    case 1:
                        {
                            this.mLevelTwoPizzas.Add(name);
                            break;
                        }
                    case 2:
                        {
                            this.mLevelThreePizzas.Add(name);
                            break;
                        }
                    case 3:
                        {
                            this.mLevelFourPizzas.Add(name);
                            break;
                        }
                    case 4:
                        {
                            
                            this.mLevelFivePizzas.Add(name);
                            break;
                        }
                }
            }
        }

        public List<string> viewMenu(int currentLevel)
        {
            switch (currentLevel)
            {
                case 1:
                    {
                        return this.mLevelOnePizzas;
                    }
                case 2:
                    {
                        return this.mLevelTwoPizzas;
                    }
                case 3:
                    {
                        return this.mLevelThreePizzas;
                    }
                case 4:
                    {
                        return this.mLevelFourPizzas;
                    }
                case 5:
                    {
                        return this.mLevelFivePizzas;
                    }
            }

            return null;
        }
    }
}
